import ProductDetail from "@/components/hero/product-details";

// This function would typically fetch data from an API or database
async function getProduct(id: string) {
  // For demonstration, we're returning mock data
  return {
    id,
    name: "Premium Wireless Headphones",
    price: 199.99,
    rating: 4.5,
    description:
      "Experience crystal-clear audio with our Premium Wireless Headphones. Featuring advanced noise-cancellation technology, comfortable over-ear design, and long-lasting battery life.",
    priceHistory: [
      { date: "Jan", price: 249.99 },
      { date: "Feb", price: 229.99 },
      { date: "Mar", price: 219.99 },
      { date: "Apr", price: 199.99 },
    ],
    recommendations: [
      { id: 1, name: "Wireless Earbuds", price: 89.99 },
      { id: 2, name: "Bluetooth Speaker", price: 129.99 },
      { id: 3, name: "Audio Cable", price: 19.99 },
    ],
  };
}

export default async function ProductPage({
  params,
}: {
  params: { id: string };
}) {
  const product = await getProduct(params.id);
  return <ProductDetail product={product} />;
}
